#pragma once

#include <iostream>
#include <cmath>
#include <ctime>

#include "Pacman.h"
#include "Ball.h"
#include "Destructor.h"
#include "Field.h"
#include "Ghost.h"
#include "Player.h"


using namespace std;

class Scene
{
private :

	Player* player;

	//les composant de la scene
	vector <Character *> * characters;
	vector <Collectable *> * items;
	Field * field;

	//positionnement initial de la scene
	float zoom;

	float angleX;
	float angleY;

	//buffer pour le drag and drop
	float currentMousePositionX;
	float currentMousePositionY;
	float bufferMousePositionX;
	float bufferMousePositionY;
	bool mouse;
	bool wheel;

	//compteur pour la colision pacman ghost
	double eaterCounter;

	//compteur pour le depart
	double beginCounter;

public:
	Scene(Player * p);
	~Scene(void);

	void displayAll1();
	void displayAll2();
	void action();

	void SetCameraPosition();

	void colisionManagement();
	bool colisionPacmanGhost();
	void counterManagement();

	void placeItems(int x, int z); // x et z sont des point qui doivent contenir une boule
	void fillItems(int x, int z);
	void sortBalls();
	void removeSquareballs(int x1, int z1, int x2, int z2);
	void transformBall(int x,int z);
	void createCharacters();
	void resetCharacters();

	bool win();
	bool lose();

	//Setters & getters
	void setZoom(float f);
	float getZoom();
	void setAngleX(float f);
	float getAngleX();
	void setAngleY(float f);
	float getAngleY();
	bool getMouse();
	void setMouse(bool b);
	void setWheel(bool b);
	bool getWheel();
	float getCurrentMousePositionX();
	float getCurrentMousePositionY();
	float getBufferMousePositionX();
	float getBufferMousePositionY();
	void setCurrentMousePositionX(float x);
	void setCurrentMousePositionY(float y);
	void setBufferMousePositionX(float x);
	void setBufferMousePositionY(float y);
	bool isGetReadyTime();
	Pacman * getPacman();
	Field* getField();

};

